/*******************************************************************************
*   			Impacts of a Large-Scale Parenting Program: 				   *
*					Experimental Evidence from Chile						   *
********************************************************************************


	REQUIRES:	"$dt_int/baseline_for figures.dta"
	CREATES:	${out_tables}/F4A_parentalbeliefs.eps
				
	WRITEN BY:  Italo Lopez  [italolop@usc.edu]

********************************************************************************
	Prepare data
*******************************************************************************/

	* Load data
	use "$dt_int/baseline_for figures.dta", clear



/*******************************************************************************
*   Set macros for regressions
*******************************************************************************/
	
	* Var labels 
	
	* Plot settings 
	*--------------------------------- 
	set scheme white_tableau
	graph set window fontface "Times New Roman"
	global graph_pref "graphregion(color(white) margin(vsmall)) "

/*******************************************************************************
Figure A4: Baseline parental beliefs
*******************************************************************************/

** Figure A4
** FCI vs Educ **
twoway (lowess perm_bin_pv_old pc_edu_old if inrange(edadtramos,1,6), lcolor(black)) /*
*/ (lowess arian_bin_pv_old  pc_edu_old  if inrange(edadtramos,1,6), lcolor(black) lpattern(dash)), /*
*/ ytitle("IAP IRT score", size(medium)) /*
*/ xtitle("Primary Caregiver Education", size(medium)) /*
*/ xlabel(, valuelabel nogrid) ylabel(-.6(.1)0, nogrid) /*
*/ title("a. IAP vs Caregiver Education", size(medlarge)) /*
*/ legend(lab(1 "Permissive") lab(2  "Authoritatian") pos(6)) /*
*/ name(F4A_a, replace)  /*
*/ ytitle("IRR raw score")


twoway (kdensity PSCS_old if pc_edu_old == 1, kernel(gaussian) lcolor(black) ) /*
*/ (kdensity PSCS_old if pc_edu_old == 2, kernel(gaussian) lcolor(black) lpatter(dash) ) /*
*/ (kdensity PSCS_old if pc_edu_old == 3, kernel(gaussian) lcolor(black) lpatter(dot) lwidth(.5)) /*
*/ (kdensity PSCS_old if pc_edu_old == 4, kernel(gaussian) lcolor(black)  lpatter(shortdash) ), /*
*/ ytitle("kdensity",  size(medium)) /*
*/ xtitle("PSCS score", size(medium)) /* 
*/ xlabel(20(20)100, valuelabel nogrid) ylabel(, nogrid) /*
*/ title("b. Parental Self-efficacy by Caregiver Education", size(medlarge))  /*
*/ legend(lab(1 "Primary") lab(2  "HS Dropout") /*
*/ lab(3  "HS Degree") lab(4  "Tertiary") pos(6) rows(2)) /*
*/ name(F4A_b, replace)  /*
*/ ytitle("Probability density of PSCS raw score")


	graph combine F4A_a F4A_b, rows(1) xsize(8)
	gr export "$out_graphs/appendix/F4A_parentalbeliefs.eps", replace
	gr export "$out_graphs/appendix/F4A_parentalbeliefs.wmf", replace 
	gr export "$out_graphs/appendix/F4A_parentalbeliefs.png", replace 

